package com.ruoyi.web.controller.applet;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.dto.BdmCommentDto;
import com.ruoyi.system.domain.dto.BdmCommentHistoryDto;
import com.ruoyi.system.domain.vo.BdmCommentVo;
import com.ruoyi.system.service.IBdmCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 小程序-评论
 *
 * @author ruoyi
 * @date 2024-12-23
 */
@RestController
@RequestMapping("/applet/comment")
public class AppletCommentController extends BaseController {


    @Autowired
    private IBdmCommentService bdmCommentService;


    /**
     * 新增评论
     */
    @PostMapping
    public AjaxResult addComment(@RequestBody BdmCommentDto bdmCommentDto)
    {
        return toAjax(bdmCommentService.addComment(bdmCommentDto));
    }

    /**
     * 查询当前用户历史评论
     */
    @GetMapping("/history")
    public AjaxResult history(BdmCommentHistoryDto bdmCommentHistoryDto)
    {
        List<BdmCommentVo> bdmCommentList= bdmCommentService.history(bdmCommentHistoryDto);
        return success(bdmCommentList);
    }



}


















